﻿using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using BIS.Utility.DAL.DataMapper;
using BIS.Utility.Converter;

namespace BIS.Portal.Modules.CMS.Entity
{
    public class AdminCmsCategoryEntity : IEntity
    {

        #region Private member

        private int _category_id;
        private int _parent_category_id;
        private string _category_page_alias;
        private string _article_page_alias;
        private int _language_in_use_id;
        private string _category_name;
        private string _category_description;
        private string _category_meta_title;
        private string _category_meta_keyword;
        private string _category_meta_description;
        private string _category_direct_url;
        private int _category_type;
        private int _priority;
        private int _show_in_menu;
        private int _use_direct_url;
        private DateTime _last_update;
        private string _last_update_by;
        private int _status;


        #endregion

        #region Pulbic contructor

        public int Category_id
        {
            get { return _category_id; }
            set { _category_id = value; }
        }

        public int Parent_category_id
        {
            get { return _parent_category_id; }
            set { _parent_category_id = value; }
        }

        public string Category_page_alias
        {
            get { return _category_page_alias; }
            set { _category_page_alias = value; }
        }

        public string Article_page_alias
        {
            get { return _article_page_alias; }
            set { _article_page_alias = value; }
        }

        public int Language_in_use_id
        {
            get { return _language_in_use_id; }
            set { _language_in_use_id = value; }
        }

        public string Category_name
        {
            get { return _category_name; }
            set { _category_name = value; }
        }

        public string Category_description
        {
            get { return _category_description; }
            set { _category_description = value; }
        }

        public string Category_meta_title
        {
            get { return _category_meta_title; }
            set { _category_meta_title = value; }
        }

        public string Category_meta_keyword
        {
            get { return _category_meta_keyword; }
            set { _category_meta_keyword = value; }
        }

        public string Category_meta_description
        {
            get { return _category_meta_description; }
            set { _category_meta_description = value; }
        }

        public string Category_direct_url
        {
            get { return _category_direct_url; }
            set { _category_direct_url = value; }
        }

        public int Category_type
        {
            get { return _category_type; }
            set { _category_type = value; }
        }

        public int Priority
        {
            get { return _priority; }
            set { _priority = value; }
        }

        public int Show_in_menu
        {
            get { return _show_in_menu; }
            set { _show_in_menu = value; }
        }

        public int Use_direct_url
        {
            get { return _use_direct_url; }
            set { _use_direct_url = value; }
        }

        public DateTime Last_update
        {
            get { return _last_update; }
            set { _last_update = value; }
        }

        public string Last_update_by
        {
            get { return _last_update_by; }
            set { _last_update_by = value; }
        }

        public int Status
        {
            get { return _status; }
            set { _status = value; }
        }

        #endregion

        #region Pulbic properties

        public AdminCmsCategoryEntity()
        {
        }

        public AdminCmsCategoryEntity(int categoryId, int parentCategoryId, string categoryPageAlias, string articlePageAlias, int languageInUseId, string categoryName, string categoryDescription, string categoryMetaTitle, string categoryMetaKeyword, string categoryMetaDescription, string categoryDirectUrl, int categoryType, int priority, int showInMenu, int useDirectUrl, DateTime lastUpdate, string lastUpdateBy, int status)
        {
            _category_id = categoryId;
            _parent_category_id = parentCategoryId;
            _category_page_alias = categoryPageAlias;
            _article_page_alias = articlePageAlias;
            _language_in_use_id = languageInUseId;
            _category_name = categoryName;
            _category_description = categoryDescription;
            _category_meta_title = categoryMetaTitle;
            _category_meta_keyword = categoryMetaKeyword;
            _category_meta_description = categoryMetaDescription;
            _category_direct_url = categoryDirectUrl;
            _category_type = categoryType;
            _priority = priority;
            _show_in_menu = showInMenu;
            _use_direct_url = useDirectUrl;
            _last_update = lastUpdate;
            _last_update_by = lastUpdateBy;
            _status = status;
        }

        #endregion

        #region Implement From IEntity Member
        public void Fill(System.Data.IDataReader reader)
        {
            Category_id = Functions.GetInt(reader["category_id"]);
            Parent_category_id = Functions.GetInt(reader["parent_category_id"]);
            Category_page_alias = Functions.GetString(reader["category_page_alias"]);
            Article_page_alias = Functions.GetString(reader["article_page_alias"]);
            Language_in_use_id = Functions.GetInt(reader["language_in_use_id"]);
            Category_name = Functions.GetString(reader["category_name"]);
            Category_description = Functions.GetString(reader["category_description"]);
            Category_meta_title = Functions.GetString(reader["category_meta_title"]);
            Category_meta_keyword = Functions.GetString(reader["category_meta_keyword"]);
            Category_meta_description = Functions.GetString(reader["category_meta_description"]);
            Category_direct_url = Functions.GetString(reader["category_direct_url"]);
            Category_type = Functions.GetInt(reader["category_type"]);
            Priority = Functions.GetInt(reader["priority"]);
            Show_in_menu = Functions.GetInt(reader["show_in_menu"]);
            Use_direct_url = Functions.GetInt(reader["use_direct_url"]);
            Last_update = Functions.GetDateTime(reader["last_update"]);
            Last_update_by = Functions.GetString(reader["last_update_by"]);
            Status = Functions.GetInt(reader["status"]);

        }
        #endregion

    }
}
